package cn.zane.domain.activity.service;

import cn.zane.domain.activity.model.entity.MarketProductEntity;
import cn.zane.domain.activity.model.entity.TrialBalanceEntity;
import cn.zane.domain.activity.service.trial.factory.DefaultActivityStrategyFactory;
import cn.zane.domain.activity.service.trial.node.RootNode;
import cn.zane.types.design.framework.tree.StrategyHandler;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author: zane
 * @date: 2025-10-24
 * @description: TODO
 */
@Service
public class IndexGroupBuyMarketServiceImpl implements IIndexGroupBuyMarketService {

    @Resource
    private DefaultActivityStrategyFactory defaultActivityStrategyFactory;


    @Override
    public TrialBalanceEntity indexMarketTrial(MarketProductEntity marketProductEntity) throws Exception {
        StrategyHandler<MarketProductEntity, DefaultActivityStrategyFactory.DynamicContext, TrialBalanceEntity> strategyHandler = defaultActivityStrategyFactory.strategyHandler();
        return strategyHandler.apply(marketProductEntity, new DefaultActivityStrategyFactory.DynamicContext());
    }
}
